package cn.edu.swpu.sims.service;

import cn.edu.swpu.sims.model.Student;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 码之泪殇
 * @date 2020/9/12 15:01
 * 到达胜利之前，无法回头
 */
public interface StudentService {
    /**
     * 通过Sno查询student
     * @param sno 用户名
     * @return student
     */
    Student getStudentBySno(String sno);

    /**
     * 获取student-list
     * @param type 字段类型
     * @param value 字段值
     * @return list<Student>
     */
    List<Student> getAllStudent(String type, String value);

    /**
     * 添加student
     * @param student student
     * @return int
     */
    int saveStudent(Student student);

    /**
     * delete student by id
     * @param id id
     */
    void deleteStudentById(@Param("id") int id);

    /**
     * get student by id
     * @param id
     * @return student
     */
    Student getStudentById(int id);

    /**
     * 更新student
     * @param student
     * @return
     */
    int updateStudent(Student student);
}
